package com.yuyou.tas.lesson.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.netflix.client.config.DefaultClientConfigImpl;

import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@Validated
@RestController
@RequestMapping(value="/api/test")
public class TestController extends BaseController{
	

	@Value("${server.port}")
	private  String port;
	
	
	
	@RequestMapping(value="/terminal" ,method=RequestMethod.GET)
	public String upgradeLesson(HttpServletRequest request) throws Exception{
		
//		DefaultClientConfigImpl
//		AvailabilityFilteringRule
		
		if(port.equals("5004")){
			System.out.println(10000+"port:"+port+"-start:"+Thread.currentThread().getName()+":"+port);
			Thread.sleep(5000);	
			System.out.println(10000+"port:"+port+"-finish"+Thread.currentThread().getName()+":"+port);
			return 20+"oooooooooooo";		
		}else{
			System.out.println(20000+"port:"+port+"-start:"+Thread.currentThread().getName()+":"+port);
			System.out.println(20000+"port:"+port+"-finish"+Thread.currentThread().getName()+":"+port);
			return 10+"kkkkkkkkkkk";
		}
	}
	

	
	
	
	
}
